import request from '@/utils/request'

const api_name = '/supplier'

export default {
  addsupplierinfo(supplierVO) {
    return request({
      url: `${api_name}/add`,
      method: 'get',
      params: supplierVO
    })
  },
  getAllProduct(productInfo) {
    return request({
      url: `${api_name}/allproduct`,
      method: 'post',
      data: productInfo
    })
  },
  getAllsupplier() {
    return request({
      url: `${api_name}/allsupplier`,
      method: 'post'
    })
  },
  allBySupplier(formData) {
    return request({
      url: `${api_name}/allBySupplierVO`,
      method: 'post',
      data: formData
    })
  },
  addproduct(productInfo) {
    return request({
      url: `${api_name}/addproduct`,
      method: 'post',
      data: productInfo
    })
  },
  remove(productid, supplierid) {
    return request(({
      url: `${api_name}/remove/${productid}/${supplierid}`,
      method: 'delete'
    }))
  },
  update(updateproductInfo) {
    return request({
      url: `${api_name}/update`,
      method: 'post',
      data: updateproductInfo
    })
  },
  updateQuantity(orderInfo) {
    return request({
      url: `${api_name}/updateQuantity`,
      method: 'post',
      data: orderInfo
    })
  },
  getAllSupplierCount() {
    return request({
      url: `${api_name}/supplierCount`,
      method: 'get'
    })
  },
  getModelAndCount(id) {
    return request({
      url: `${api_name}/getModelAndCount/${id}`,
      method: 'get'
    })
  }

}
